package com.twotiger.and.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class JpushNoticeOpenHelper extends SQLiteOpenHelper {

    public static final int VERSIONCODE = 1; // 版本号
    public static final String DBNAME = "jpush.db"; //数 据库名字
    public static final String TABNAME = "notice"; //表明

    public JpushNoticeOpenHelper(Context context) {
        // name 数据库的名字 factory 游标工厂 version 版本号
        super(context, DBNAME, null, VERSIONCODE);
    }

    // 数据库第一次创建的时候调用 适合初始化表结构
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table "
                   + TABNAME
                   + "(id integer primary key autoincrement,notifactionId varchar(20),notifactionAlert text,notifactionTitle text, notifactionContent text);");
    }

    // 数据版本更新的时候调用
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
